import math
class Graphic :
    def __init__(self,name) -> None:
        self.name = name
    def cal_square(self):
        pass
class Triangle (Graphic) :
    def __init__(self, name,height,broder) -> None:
        super().__init__(name)
        self.height = height
        self.broder = broder
    def cal_square(self):
        square = 1/2 * self.height * self.broder
        print(f"{self.name}面积为{square:.2f}")
class Circle(Graphic) :
    def __init__(self, name,radius) -> None:
        super().__init__(name)
        self.radius = radius
    def cal_square(self):
        square = math.pi * pow(self.radius,2)
        print(f"{self.name}面积为{square:.3f}")
t1 = Triangle("三角形",6,8)
t1.cal_square()
c1 = Circle("圆",3)
c1.cal_square()